package com.example.serviceImpl;

import com.example.bean.Admin;
import com.example.bean.SuperAdmin;
import com.example.bean.User;
import com.example.mapper.LoginMapper;
import com.example.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl implements LoginService {
    @Autowired
    private LoginMapper loginMapper;

    @Override
    public User judgeLogin(String userPhone, String userIdentity, String card) {
        return loginMapper.judgeLogin(userPhone,userIdentity,card);
    }

    @Override
    public User userPhoneLogin(String userPhone, String userPassword) {
        System.out.println(userPhone + "--" + userPassword);
        System.out.println(loginMapper);
        return loginMapper.userPhoneLogin(userPhone,userPassword);
    }

    @Override
    public User userIdentityLogin(String userIdentity, String userPassword) {
        return loginMapper.userIdentityLogin(userIdentity,userPassword);
    }

    @Override
    public User cardLogin(String card, String userPassword) {
        return loginMapper.cardLogin(card,userPassword);
    }

    @Override
    public Admin adminLogin(String adminId, String adminPassword) {
        return loginMapper.adminLogin(adminId,adminPassword);
    }

    @Override
    public SuperAdmin superAdmLogin(String superAdmId, String superAdmPassword) {
        return loginMapper.SuperAdmLogin(superAdmId,superAdmPassword);
    }
}
